package demo.dcs.util;


import demo.java.lang.management.jvm.AppTraceConfig;

public class PatrolUtils {

	public final static String BEAN_NAME_LOG_STAT = "com.ximalaya.xdcs:type=LogStats";
	public final static String BEAN_NAME_EXCEPTION = "com.ximalaya.xdcs:type=Exception";
	public final static String BEAN_APP_CONFIG_EXCEPTION = "com.ximalaya.xdcs.config:type=AppTraceConfig";


	
	public static void registerAppConfigMBean(AppTraceConfig appTraceConfig) {
		JMXUtils.register(BEAN_APP_CONFIG_EXCEPTION, appTraceConfig); // 兼容
	}
	public static void unregisterAppConfigMBean(AppTraceConfig appTraceConfig) {
		JMXUtils.unregister(BEAN_APP_CONFIG_EXCEPTION); // 兼容
	}


	public static void unregisterMBean() {
		JMXUtils.unregister(BEAN_NAME_LOG_STAT);
		// TODO remove it
		JMXUtils.unregister(BEAN_NAME_EXCEPTION);
	}
}
